package cn.gok.common.dao.customer;

import cn.gok.common.entity.customer.CustomerInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author r: shikundai
 * @Time: 2020/9/26  11:22
 * @description: 顾客信息持久化层
 */
@Repository
@Mapper
public interface CustomerInfoDao extends BaseMapper <CustomerInfo> {

    /**
     * 选择已删除的客户信息
     *
     * @return
     */
    @Select("select * from c_customer_info where IS_DEL = 1")
    List <CustomerInfo> pageDel();

    @Delete("delete from c_customer_info where CUSTOMER_INF_ID = #{id}")
    int delCustomerInfo(Long id);

    @Update("update c_customer_info set IS_DEL = 0 where CUSTOMER_INF_ID = #{id}")
    int delRollBack(Long id);
}
